home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / include / user / RCS / assert.h,v < prev    next >
Encoding:
Text File  |  1992-07-17  |  2.4 KB  |  117 lines

  1. head     1.2;
  2. branch   ;
  3. access   ;
  4. symbols  srv030:1.2 srv027:1.2 srv026:1.2 srv024:1.2 srv021:1.2 srv019:1.2 srv018:1.2 srv016:1.2 srv014:1.2 srv010:1.2 srv008:1.2 srv007:1.2 srv006:1.2 srv005:1.2 srv004:1.2 srv003:1.2 srv002:1.2 srv001:1.2;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.2
  10. date     91.12.01.22.18.48;  author kupfer;  state Exp;
  11. branches ;
  12. next     1.1;
  13.  
  14. 1.1
  15. date     91.11.21.18.44.17;  author kupfer;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19.  
  20. desc
  21. @@
  22.  
  23.  
  24. 1.2
  25. log
  26. @Changes for sprited.
  27. @
  28. text
  29. @/*
  30.  * assert.h --
  31.  *
  32.  *  Definition of assert() macro.
  33.  *
  34.  * Copyright 1988 Regents of the University of California
  35.  * Permission to use, copy, modify, and distribute this
  36.  * software and its documentation for any purpose and without
  37.  * fee is hereby granted, provided that the above copyright
  38.  * notice appear in all copies.  The University of California
  39.  * makes no representations about the suitability of this
  40.  * software for any purpose.  It is provided "as is" without
  41.  * express or implied warranty.
  42.  *
  43.  * $Header: /r3/kupfer/spriteserver/include/user/RCS/assert.h,v 1.1 91/11/21 18:44:17 kupfer Exp Locker: kupfer $
  44.  */
  45.  
  46. #include <cfuncproto.h>
  47.  
  48. #ifdef assert
  49. #undef assert
  50. #endif
  51.  
  52. #ifdef _assert
  53. #undef _assert
  54. #endif
  55.  
  56. #ifndef NDEBUG
  57. #if defined(KERNEL) || defined(SPRITED)
  58. #ifdef __STDC__
  59.  
  60. #define _assert(ex) { if (!(ex)) { panic(\
  61.     "Assertion failed: (" #ex ") file \"%s\", line %d\n", __FILE__, __LINE__);}}
  62.  
  63. #else /* __STDC__ */
  64.  
  65. #define _assert(ex) { if (!(ex)) { panic(\
  66.     "Assertion failed: file \"%s\", line %d\n", __FILE__, __LINE__);}}
  67. #endif /* __STDC__ */
  68.  
  69. #else /* KERNEL || SPRITED */
  70.  
  71. _EXTERN void __eprintf _ARGS_ ((_CONST char *string,
  72.     int line, _CONST char *filename));
  73.  
  74. #ifdef __STDC__
  75.  
  76. #define _assert(ex) { if (!(ex)) { __eprintf( \
  77.     "Assertion failed: (" #ex ") line %d of \"%s\"\n", __LINE__, __FILE__);\
  78.     abort();}}
  79.  
  80. #else /* __STDC__ */
  81.  
  82. #define _assert(ex) { if (!(ex)) { __eprintf( \
  83.     "Assertion failed: line %d of \"%s\"\n", __LINE__, __FILE__);\
  84.     abort();}}
  85.  
  86. #endif /* __STDC__ */
  87.  
  88. #endif /* KERNEL || SPRITED */
  89.  
  90. # define assert(ex)    _assert(ex)
  91. # else  /* !NDEBUG */
  92. # define _assert(ex)
  93. # define assert(ex)
  94. # endif /* !NDEBUG */
  95.  
  96. @
  97.  
  98.  
  99. 1.1
  100. log
  101. @Initial revision
  102. @
  103. text
  104. @d15 1
  105. a15 1
  106.  * $Header: /sprite/src/lib/include/RCS/assert.h,v 1.6 90/11/06 17:21:14 rab Exp $
  107. d29 1
  108. a29 1
  109. #ifdef KERNEL
  110. d41 1
  111. a41 1
  112. #else /* KERNEL */
  113. d60 1
  114. a60 1
  115. #endif /* KERNEL */
  116. @
  117.